package com.universal_library.utils;

import android.content.Context;
import android.util.DisplayMetrics;

/**
 * Created by solin on 2018/2/28.
 */

public class DeviceUtil {

    //*******************************获取手机屏幕的宽高*************************************///
    public static DisplayMetrics getDisplayMetrics(Context context) {
        return context.getResources().getDisplayMetrics();
    }

    public static float getScreenHeight(Context context) {
        return getDisplayMetrics(context).heightPixels;
    }

    public static float getScreenWidth(Context context) {
        return getDisplayMetrics(context).widthPixels;
    }
}
